from pages.base_page import BasePage
from selenium.webdriver.common.by import By


class PayPage(BasePage):
    url = "/pay-stock/D52165"
    wechat_pay_locater = (By.XPATH,'//*[@id="root"]/div/div/div[2]/div[1]/div[4]/div/label[2]/span[2]/div/span')
    next_step_locater = (By.XPATH,'//*[@id="root"]/div/div/div[2]/div[1]/div[4]/button/span')
    action_locater = (By.XPATH,'//*[@id="root"]/div/div[2]/div/div/div/div[1]')
    confirm_locater = (By.XPATH,'//*[@id="root"]/div/div[2]/div/button/span')

    def choice_wechat_pay(self):
        """选择微信支付"""
        self.click(self.wechat_pay_locater)

    def click_next_step(self):
        """点击下一步"""
        self.click(self.next_step_locater)

    def click_action_button(self):
        """点击操作框"""
        self.click(self.action_locater)

    def click_action(self):
        """选择支付操作"""
        self.click_position(755,390)


    def click_confirm_pay(self):
        """确认支付"""
        self.click(self.confirm_locater)